<!--
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
-->
<!--
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
-->
<template>
  <div class="box">
    <h1>这是A组件,{{ count.num }}</h1>
    <van-button type="primary" @click="count.increment">数字+</van-button>
    <div v-for="item in cfy.list" :key="item.objectId">
      {{ item.name }}
    </div>
    <van-button type="primary" @click="handleAdd">本地新增分类</van-button>
  </div>
</template>

<script setup lang="ts">
import { useCounter } from "../../store/count";
import { useClassify } from "../../store/classify";
const count = useCounter();
const cfy = useClassify();
const handleAdd = () => {
  cfy.list.push({
    name: "钏哥",
    icon: "img.png",
  });
};
</script>

<style scoped>
.box {
  height: 50vh;
  border: 1px solid #333;
}
</style>
